<!DOCTYPE html>

<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">

  <body>

    <h2>Proprietari</h2>

    <table id="owners" class="table table-striped">
        <thead>
        <tr>
            <th style="width: 150px;">Numele</th>
            <th style="width: 200px;">Adresa</th>
            <th>Localitate</th>
            <th style="width: 120px">Telefon</th>
            <th>Animale</th>
        </tr>
        </thead>
        <tbody>
          <tr th:each="owner : ${selections}">
              <td>
                  <a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}"/></a>
              </td>
              <td th:text="${owner.address}"/>
              <td th:text="${owner.city}"/>
              <td th:text="${owner.telephone}"/>
              <td><span th:each="pet : ${owner.pets}" th:text="${pet.name} "/></td>
          </tr>
        </tbody>
    </table>

  </body>
</html>
